<template>
  <div>
    <a-card class="card" :bordered="false" :style="`min-height: ${cardMinHeight}px;`">
    <!--新增-->
    <a-modal
          destroyOnClose
          v-model='addModal'
          width='1100px'
          :title="isAdd?'新增':title"
          @cancel="handleCancel0"
          @ok="submitAddParams"
          :bodyStyle="bodyStyle"
      >
        <a-spin :spinning="spinning">
          <div style="width: 100%;min-height: 200px;display: flex;flex-direction: row;padding: 10px 24px 10px 24px;justify-content: center">
            <div style="width: 98%;">
              <a-form-model :model="addForm"  layout="inline"  >

                <a-form-model-item
                    label="编码"
                    required
                    style="margin-left: 40px">
                  <a-input style='width: 300px;height: 32px;' v-model.trim="addForm.code"
                           :disabled="!canBeEdited || !isAdd"></a-input>
                </a-form-model-item>

                <a-form-model-item
                    label="备件种类"
                    required
                    style="margin-left: 116px">
                  <a-popover trigger="click" placement="bottom" :overlayStyle="{ width: '300px' }">
                    <template slot="content">
                      <p class="aPopover" v-for="(item,index) in partSearchList" :key="index"  @click="changePart(item)" >
                        {{'code:'+item.code+',name:'+item.name}}</p>
                    </template>
                    <a-input style='width: 300px;height: 32px;'
                             v-model.trim="addForm.part_code"
                             placeholder="*备件编码(搜索)"
                             allowClear
                             @keydown.enter="getPartListByPartCode(addForm.part_code)"
                             @change="getPartListByPartCode(addForm.part_code)"
                             @click="getPartListByPartCode(addForm.part_code)"
                             :disabled="!canBeEdited || !isAdd"></a-input>
                  </a-popover>
                </a-form-model-item>

                <a-form-model-item
                    label="数量"
                    required
                    style="margin-left: 40px">
                  <a-input style='width: 300px;height: 32px;' v-model.trim="addForm.quantity"
                           @change="searchAvailableInventory"
                           :disabled="!canBeEdited || !isAdd"></a-input>
                </a-form-model-item>

                <a-form-model-item
                    label="满足条件库存id号及数量"
                    required
                    style="margin-left: 20px">
                  <a-select
                      style='width: 300px;height: 32px;'
                      allowClear
                      @change="changeInventoryId(addForm.part_inventory_id)"
                      v-model.trim="addForm.part_inventory_id"
                      :disabled="!canBeEdited || !isAdd"
                  >
                    <a-select-option
                        v-for='item in addForm.parts_inventory_available_list'
                        :key='item.id'
                        :value='item.id'
                    >{{'id:'+item.id+',quantity:'+item.quantity}}</a-select-option>
                  </a-select>
                </a-form-model-item>



                <a-form-model-item
                    label="领用日期"
                    style="margin-left: 23px">
                  <a-date-picker
                      format="YYYY-MM-DD"
                      show-time
                      allowClear
                      placeholder="领用日期"
                      v-model.trim="addForm.receive_time"
                      @change="onChangeReceiveDate"
                      style='width: 300px;height: 32px;'
                      :disabled="!canBeEdited || !isAdd"
                  />
                </a-form-model-item>

                <a-form-model-item
                    label="设备"
                    style="margin-left: 155px">
                  <a-popover trigger="click" placement="bottom" :overlayStyle="{ width: '300px' }">
                    <template slot="content">
                      <p class="aPopover" v-for="(item,index) in deviceNameSearchList" :key="index"  @click="changeDeviceCode2(item)" >
                        {{'code:'+item.code+',name:'+item.name}}</p>
                    </template>
                    <a-input style='width: 300px;height: 32px;'
                             @change="getDeviceByCode(addForm.device_code)"
                             placeholder="*编码(输入设备编码搜索)"
                             allowClear
                             @click="getDeviceByCode(addForm.device_code)"
                             @keydown.enter="getDeviceByCode(addForm.device_code)"
                             v-model.trim="addForm.device_code"
                             v-auth="`query`"></a-input>
                  </a-popover>
                </a-form-model-item>

                <a-form-model-item
                    label="领用人"
                    style="margin-left: 37px">
                  <a-popover  trigger="click" placement="bottom" :overlayStyle="{ width: '300px' }">
                    <template slot="content">
                      <p class="aPopover" v-for="(item,index) in userSearchList" :key="index"  @click="changeUser2(item)" >{{item.name}}</p>
                    </template>
                    <a-input style='width: 300px;height: 32px'
                             v-model.trim="addForm.receiver_name"
                             @keydown.enter="getUserList(addForm.receiver_name)"
                             @change="getUserList(addForm.receiver_name)"
                             allowClear
                             @click="getUserList(addForm.receiver_name)"
                             placeholder="搜索用户"
                             v-auth="`query`" ></a-input>
                  </a-popover>
                </a-form-model-item>
              </a-form-model>
            </div>
          </div>
        </a-spin>
      </a-modal>


      <page-head-area>
        <div class="extra" style="width: 200px;display: flex;justify-content: space-around">
          <a-button icon="plus-circle" v-auth="`insert`" @click="add" style="background-color: #fff;border: none;margin-left: 10px;width: 70px;height: 35px;">新增</a-button>
          <a-popconfirm title="批量删除?" @confirm="deleteSelect">
            <a-button icon="delete" v-auth="`delete`" style="background-color: #fff;border: none;margin-left: 10px;width: 70px;height: 35px;">删除</a-button>
          </a-popconfirm>
<!--          <a-button icon="audit"  style="background-color: #eeeeee;border: none;margin-left: 10px;width: 70px;height: 35px;">审核</a-button>-->
        </div>
      </page-head-area>

      <div class="queryBox">
        <a-form-model layout="inline" :model='queryForm'  class='query' style='display: flex;flex-wrap: wrap;'>
          <a-form-model-item
              class='optionTitle'
              label="编码"
          >
            <a-input style='width: 150px;height: 32px' v-model='queryForm.code' v-auth="`query`"></a-input>
          </a-form-model-item>

          <a-form-model-item
              label="领用人"
          >
            <a-popover  trigger="click" placement="bottom" :overlayStyle="{ width: '250px' }">
              <template slot="content">
                <p class="aPopover" v-for="(item,index) in userSearchList" :key="index"  @click="changeUser(item)" >{{item.name}}</p>
              </template>
              <a-input style='width: 250px;height: 32px'
                       v-model.trim="queryForm.receiver_name"
                       allowClear
                       @keydown.enter="getUserList(queryForm.receiver_name)"
                       @change="getUserList(queryForm.receiver_name)"
                       @click="getUserList(queryForm.receiver_name)"
                       placeholder="搜索用户"
                       v-auth="`query`" ></a-input>
            </a-popover>
          </a-form-model-item>

          <a-form-model-item
              label="维修设备"
          >
            <a-popover trigger="click" placement="bottom" :overlayStyle="{ width: '250px' }">
              <template slot="content">
                <p class="aPopover" v-for="(item,index) in deviceNameSearchList" :key="index"  @click="changeDeviceCode(item)" >
                  {{'code:'+item.code+',name:'+item.name}}</p>
              </template>
              <a-input style='width: 250px;height: 32px;'
                       @change="getDeviceByCode(queryForm.repair_device_code)"
                       placeholder="*编码(输入设备编码搜索)"
                       allowClear
                       @click="getDeviceByCode(queryForm.repair_device_code)"
                       @keydown.enter="getDeviceByCode(queryForm.repair_device_code)"
                       v-model.trim="queryForm.repair_device_code"
                       v-auth="`query`"></a-input>
            </a-popover>
          </a-form-model-item>

          <a-form-model-item
              label="日期范围"
          >
            <a-range-picker
                format="YYYY-MM-DD"
                v-model.trim="queryForm.dateSelect"
                :allow-clear="true"/>
          </a-form-model-item>

          <a-form-model-item>
            <a-button type='primary' style='height: 32px;width: 70px;text-align: center' @click="reset" v-auth="`query`">
              重置
            </a-button>
          </a-form-model-item>
          <a-form-model-item>
            <a-button type='primary' style='height: 32px;width: 70px;text-align: center' @click="filter" v-auth="`query`">
              搜索
            </a-button>
          </a-form-model-item>

        </a-form-model>
      </div>
      <div class="dataBox">
        <a-table
            :columns="columns"
            :data-source="data"
            :pagination="false"
            :loading="tableLoading"
            :rowKey="(recordMain) => {return recordMain.id}"
            :scroll="{ x: 1000, y: 500 }"
            :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <template slot="action" slot-scope="record">
            <a v-auth="`query`" >退货</a>
          </template>
        </a-table>

      </div>
      <a-pagination
          @change="onChangePage"
          @showSizeChange="showSizeChange"
          :total="pagination.total"
          :showSizeChanger="true"
          :showQuickJumper="true"
          :defaultPageSize="pagination.defaultPageSize"
          :pageSize="pagination.page_size"
          :pageSizeOptions="pagination.pageSizeOptions"
          :current="pagination.current"
          :showTotal="pagination.showTotal"
          style="width: 100%;display: flex;flex-direction: row;justify-content: flex-end;margin-top: 15px"
      ></a-pagination>
    </a-card>
  </div>
</template>

<script>

import {mapGetters} from "vuex";
import PageHeadArea from "../module/pageHeadArea.vue";
import pagination from "ant-design-vue/lib/pagination";
import storage from "store";
import {DEPT_ID, ORGANIZATION_ID, USER_TOKEN} from "@/store/mutation-types";
import axios from "axios";
import moment from "moment";
import {
  file_import, file_upload,
  get_employee_list,
  get_extended_define, get_asset_file_list, get_supplier, get_unit_list, download_file,
  get_organization_list,
  delete_asset, get_asset_list, save_asset, update_asset,
  get_category_type_list, get_organization_profile_list, get_template_list, update_extend
} from "@/services/manage";
import {
  deleteSparePartsReceive,
  deleteSparePartsRequest, getCacheByVaguename,
  getDeviceList,
  getPartsById,
  getSparePartsInventoryList,
  getSparePartsRequestList,
  getUserNameById, listDeviceRepairAll, listDeviceRepairSparePartsReceiveRelation, listSpareParts,
  listSparePartsReceive, saveSparePartsReceive
} from "../../utils/interface";
import {message} from "ant-design-vue";
import {list_spare_parts_receive} from "../../services/deviceRepair";
const data = [
  { id: 1, code: '001', batch: '202201', figureNumber: '001', name: '测试1', quantity: 10, price: 100, amount: 1000, receiveDate: '2022-01-01', receiver: '张三', repairDevice: '设备1', location: '库位1' },
  { id: 2, code: '002', batch: '202202', figureNumber: '002', name: '测试2', quantity: 20, price: 200, amount: 4000, receiveDate: '2022-02-01', receiver: '李四', repairDevice: '设备2', location: '库位2' },
  { id: 3, code: '003', batch: '202203', figureNumber: '003', name: '测试3', quantity: 30, price: 300, amount: 9000, receiveDate: '2022-03-01', receiver: '王五', repairDevice: '设备3', location: '库位3' },
]
const columns = [
  { title: '编码', width: 120, align:'center', dataIndex: 'code', key: 'code'},
  { title: '批次', width: 120, align:'center', dataIndex: 'batch_code', key: 'batch_code'},
  { title: '图号', width: 120, align:'center', dataIndex: 'figure_number', key: 'figure_number'},
  { title: '数量', width: 120, align:'center', dataIndex: 'quantity', key: 'quantity'},
  { title: '价格', width: 120, align:'center', dataIndex: 'unit_price', key: 'unit_price'},
  { title: '金额', width: 120, align:'center', dataIndex: 'price', key: 'price'},
  { title: '领用日期', width: 120, align:'center', dataIndex: 'receive_time', key: 'receive_time'},
  { title: '领用人', width: 120, align:'center', dataIndex: 'receiver_name', key: 'receiver_name'},
  { title: '维修设备', width: 120, align:'center', dataIndex: 'device_name', key: 'device_name'},
  { title: '库位', width: 120, align:'center', dataIndex: 'warehouse', key: 'warehouse'},
]


export default {
  name: "userAuthority",
  components: {PageHeadArea},
  data() {
    return {
      partSearchList:[],
      addForm:{
        code: undefined,
        part_id:undefined,
        part_code:undefined,
        quantity:undefined,
        parts_inventory_available_list:[],
        part_inventory_id:undefined,
        receive_time:undefined,
        device_code:undefined,
        device_id:undefined,
        receiver_name:undefined,
        receiver_id:undefined,
      },
      deviceNameSearchList:[],
      userSearchList:[],
      selectedRowKeys:[],
      axiosSource: null,
      tabKey: '1',
      title:'',
      tabBarGutter: 0,
      tabBarStyle: {
        color: 'rgba(0, 0, 0, 0.85)'
      },
      bodyStyle: {
        'padding': '0px 24px 0px 24px',
        'font-size': '14px',
        'line-height': '1.5',
        'word-wrap': 'break-word',
      },
      cardMinHeight: 0,
      queryForm: {
        code: undefined,
        repair_device_id:undefined,
        receiver_id:undefined,
        receiver_name:undefined,
        repair_device_code:undefined,
        dateSelect:[]

      },
      statusList: [
        // {id: 1, name: '待采购', code: '0', type: 'use_status'},
        {id: 1, name: '正常运行', code: '1',type: 'use_status'},
        {id: 2, name: '不正常运行', code: '2',type: 'use_status'},
      ],
      gradesList: [
        // {id: 1, name: '待采购', code: '0', type: 'use_status'},
        {id: 1, name: '1级设备', code: '1',type: 'use_status'},
        {id: 2, name: '2级设备', code: '2',type: 'use_status'},
        {id: 3, name: '3级设备', code: '3',type: 'use_status'},
        {id: 4, name: '4级设备', code: '4',type: 'use_status'},
        {id: 5, name: '5级设备', code: '5',type: 'use_status'},
      ],
      data,
      columns,
      pagination: {
        total: 0,
        page_size: 10,
        defaultPageSize: 10,
        page: 1,
        current: 1,
        showSizeChanger: true,
        showQuickJumper: true,
        showTotal: total => `共 ${total} 条记录`,
        pageSizeOptions: ['10', '20', '50', '100', '500'],
      },
      tableLoading: false,
      addModal: false,
      canBeEdited: false, //是否可编辑
      isAdd: false, //是否为新增
      spinning: false,

      detailModal:false, //详情弹窗
      canBeQuery:false, //是否可查询

      remodelModal:false,
      disposalModal:false,
    }
  },
  watch: {},
  authorize: {
    add: 'insert',
    getAssetLedgerList: 'query',
    reset: 'query',
    query: 'query',
    detail: 'query',
    edit: 'update',
    del: 'delete',
    check: 'check',
  },
  computed: {
    ...mapGetters(['getCardMinHeight']),
  },
  created() {
    this.cardMinHeight = this.getCardMinHeight
  },
  async mounted() {
    this.axiosSource = axios.CancelToken.source();

    await this.initialize()

  },
  methods: {
    changeInventoryId(id){
      this.addForm.part_inventory_id = id
    },
    async searchAvailableInventory() {
      if (this.addForm.part_code !== undefined
          && this.addForm.part_id !== undefined
          && this.addForm.quantity !== undefined) {
        //找余数足够的库存
        let searchList = await getSparePartsInventoryList({
          'spare_parts_id': this.addForm.part_id
        })
        searchList = searchList.filter(itemS => itemS.quantity >= this.addForm.quantity)
        //从小到大排序
        searchList.sort((a, b) => a.quantity - b.quantity)
        this.addForm.parts_inventory_available_list= searchList
        // console.log(this.addForm.parts_inventory_available_list)


      }
    },
    async getPartListByPartCode(part_code){
      await listSpareParts({'code': part_code}).then(res => {
        this.partSearchList = []
        res.slice(0, 10).forEach(item => {
          this.partSearchList.push({
            id: item.id,
            code:item.code,
            name: item.name,
          })
        })
      })
    },
    async getDeviceByCode(repair_device_code) {
      await getDeviceList({'code': repair_device_code}).then(res => {
        this.deviceNameSearchList = []
        res.slice(0, 10).forEach(item => {
          this.deviceNameSearchList.push({
            id: item.id,
            code: item.code,
            name: item.name
          })
        })
      })
    },
    async getUserList(order_user) {
      this.userSearchList = []
      await getCacheByVaguename(order_user).then(res=>{
        res.slice(0, 10).forEach(item => {
          this.userSearchList.push({
            id: item.id,
            name: item.name
          })
        })
      })
      // console.log(this.userSearchList)
    },
    changeUser(item){
      this.queryForm.receiver_name=item.name;
      this.queryForm.receiver_id= item.id
      // console.log(record1)
    },
    changeUser2(item){
      this.addForm.receiver_name=item.name;
      this.addForm.receiver_id= item.id
      // console.log(record1)
    },
    changeDeviceCode(item){
      this.queryForm.repair_device_id=item.id
      this.queryForm.repair_device_code=item.code
    },
    changeDeviceCode2(item){
      this.addForm.device_id=item.id
      this.addForm.device_code=item.code
    },
    changePart(item){
      this.addForm.part_id =item.id
      this.addForm.part_code =item.code
    },
    onSelectChange(selectedRowKeys) {
      // console.log('selectedRowKeys changed: ', selectedRowKeys);
      this.selectedRowKeys = selectedRowKeys;
    },
    async deleteSelect() {
      for (const item of this.selectedRowKeys) {
        await deleteSparePartsReceive({'id': item})
      }
      this.selectedRowKeys = []
      message.success('删除成功')
      await this.initialize()
    },
    async filter() {
      //筛选
      this.pagination.page = 1
      this.pagination.current = 1
      this.pagination.page_size = 10
      this.tableLoading = true
      await this.initialize({
        'code':this.queryForm.code,
        'receiver_id':this.queryForm.receiver_name===undefined?null:this.queryForm.receiver_id,
        'device_id':this.queryForm.repair_device_code===undefined?null:this.queryForm.repair_device_id
      })
    },
    async initialize(params) {
      this.tableLoading = true
      this.data = []

      const paramsAll = Object.assign({}, params, {
        "page": this.pagination.page,
        "page_size": this.pagination.page_size
      });
      await list_spare_parts_receive(paramsAll).then(async res => {
        if (res.data.code === '1000') {
          this.pagination.total = res.data.extension.total+(this.pagination.current-1)*this.pagination.page_size
          for (const item of res.data.data) {
            item['receiver_name'] = await getUserNameById(item.receiver_id)
            let searchInventory = await getSparePartsInventoryList({'id':item.inventory_id})
            item['batch_code'] = searchInventory[0]?.batch_code || ''
            item['unit_price'] = searchInventory[0]?.unit_price || ''
            item['warehouse'] = searchInventory[0]?.warehouse || ''
            let searchRelation = await listDeviceRepairSparePartsReceiveRelation({'spare_parts_receive_id':item.id})
            if(searchRelation.length!==0){
              await listDeviceRepairAll({'id':searchRelation[0].device_repair_id}).then(async res3 => {
                let searchDevice = await getDeviceList({'id': res3[0]?.device_id})
                item['device_name'] = searchDevice[0]?.name || ''
              })
            }else{
              if(item.device_id!==null){
                let searchDevice = await getDeviceList({'id':item.device_id})
                item['device_name'] = searchDevice[0]?.name || ''
              }
              else{
                item['device_name'] = ''
              }
            }
            await getPartsById({'id':searchInventory[0].spare_parts_id}).then(res2=>{
              item['figure_number'] = res2[0]?.figure_number || ''
            })

            item['price'] = item.unit_price * item.quantity


          }
        }
        const [startDate, endDate] = this.queryForm.dateSelect;
        this.data = res.data.data.filter(itemRes => {
          return (
              (!startDate || new Date(itemRes.receive_time) >= new Date(startDate)) &&
              (!endDate || new Date(itemRes.receive_time) <= new Date(endDate))
          );
        }).slice(0, this.pagination.page_size);
        this.tableLoading = false
      })
      this.tableLoading = false
    },
    onChangePage (page, pageSize) {
      this.pagination.current = page
      this.pagination.page_size = pageSize
      this.pagination.page = page
      this.initialize()
    },
    showSizeChange(current, size){
      this.pagination.page_size = size
      this.pagination.current = current
      this.pagination.page = current
      this.initialize()
    },
    callback (key) { // assetCode
      this.tabKey = key
    },
    // 分页切换
    onChange (pagination) {
      this.pagination.current = pagination.current
      this.pagination.page_size = pagination.pageSize
      this.pagination.page = pagination.current
      this.getAssetLedgerList()
    },
    async query() {
      this.pagination.page = 1
      this.pagination.current = 0
      this.pagination.page_size = 10
      await this.initialize()
    },
    reset() {
      this.queryForm = {
        code: undefined,
        repair_device_id:undefined,
        receiver_id:undefined,
        receiver_name:undefined,
        repair_device_code:undefined,
        dateSelect:[]
      }
      this.deviceNameSearchList=[]
      this.userSearchList=[]
      this.query()
    },
    onChangeReceiveDate(value, dateString){
      this.addForm.receive_time = dateString
    },
    clearAddParams(){
      this.addForm={
            code: undefined,
            part_id:undefined,
            part_code:undefined,
            quantity:undefined,
            parts_inventory_available_list:[],
            part_inventory_id:undefined,
            receive_time:undefined,
            device_code:undefined,
            device_id:undefined,
            receiver_name:undefined,
            receiver_id:undefined,
      }
      this.deviceNameSearchList=[]
      this.userSearchList=[]
      this.partSearchList=[]
    },
    add() {
      this.clearAddParams()
      this.addModal = true
      this.canBeEdited = true
      this.isAdd = true
      this.spinning = false
    },
    handleCancel0(){
      this.clearAddParams()
      this.addModal = false
      this.canBeEdited = false
      this.isAdd = false
      this.spinning = true
    },
    async submitAddParams() {
      if (this.addForm.code === undefined || this.addForm.code === '') {
        message.error('请输入编码')
        return
      }
      if (this.addForm.part_id === undefined || this.addForm.part_id === ''
          || this.addForm.part_code === undefined || this.addForm.part_code === '') {
        message.error('请选择备件')
        return
      }
      if (this.addForm.quantity === undefined || this.addForm.quantity === '') {
        message.error('请输入数量')
        return
      }
      if (this.addForm.part_inventory_id === undefined || this.addForm.part_inventory_id === '') {
        message.error('请选择库存id号')
        return
      }
      //code查重
      let searchCodeList = await listSparePartsReceive({'code': this.addForm.code})
      let flag = true
      if(searchCodeList.length>0){
        for(const item of searchCodeList){
          if(item.code === this.addForm.code) {
            flag = false
            break
          }
        }
      }
      if(flag===false){
        message.error('编码重复')
        return
      }

      //保存
      await saveSparePartsReceive({
        'code': this.addForm.code,
        'inventory_id': this.addForm.part_inventory_id,
        'quantity': this.addForm.quantity,
        'receive_time': this.addForm.receive_time,
        'device_id':this.addForm.device_code===undefined?null:this.addForm.device_id,
        'receiver_id':this.addForm.receiver_name===undefined?null:this.addForm.receiver_id,
      }).then(res=>{
        if(res.length!==0){
          message.success('添加成功')
          this.handleCancel0()
          this.initialize()
        }
        else{
          message.error('添加失败')
        }
      })
    },
    edit(record) {
      this.addModal = true
      this.canBeEdited = true
      this.isAdd = false
      this.echo(record)
    },
    detail(record) {
      this.detailModal = true
      this.canBeEdited = false
      this.canBeQuery =true
      this.isAdd = false
      this.echo(record)
    },
    clearParameter() {},
    handleCancel() {
      this.tabKey = '1'
    },
    submit() {

    },
  },
  beforeDestroy() {
    if (this.axiosSource) {
      this.axiosSource.cancel('Request canceled due to page navigation.');
    }
  }
}
</script>

<style scoped lang="less">
.aPopover{
}
.aPopover:hover {
  background-color: #EA5413;
}
.dataBox{
  margin-top: 20px;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none; /* 隐藏滚动条 */
}

::-webkit-scrollbar {
  display: none; /* 隐藏滚动条 */
}
.hide-scrollbar {
  -ms-overflow-style: none;  /* IE 和 Edge */
  scrollbar-width: none;  /* Firefox */
  overflow-y: scroll; /* 保持内容可滚动 */
}
.demo-infinite-container {
  margin-top: 0px;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow: auto;
  padding: 8px 24px;
  height: 300px;
}
/deep/ .ant-form-inline .ant-form-item-with-help{
  margin-bottom: 0px;
}
/deep/ .ant-input[disabled]{
  pointer-events: none;
  color: #000000d9;
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 1;
}
/deep/ .unit .ant-select-selection--single{
  margin-left: 0px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}
/deep/ .ant-select-disabled .ant-select-selection {
  background-color: #fff;
}
/deep/ .ant-input[disabled]{
  pointer-events: none;
  color: #000000d9;
  background-color: #fff;
  cursor: not-allowed;
  opacity: 1;
}
/deep/ .ant-input-number-disabled{
  pointer-events: none;
  color: #000000d9;
  background-color: #fff;
  cursor: not-allowed;
  opacity: 1;
}
</style>